package com.sth.swing;

import com.sth.test1.MyJComponent1;
import com.sth.test2.MyJComponent2;
import com.sth.test3.MyJComponent3;
import com.sth.test4.MyJComponent4;
import com.sth.test5.MyJComponent5;
import com.sth.test6.MyJComponent6;
import com.sth.test7.MyJComponent7;
import com.sth.test8.MyJComponent8;

import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;

/**
 * @Author: sitianhong
 * @Description:
 * @Since: create in 2021/11/25 0025 9:25
 */
public class MyTabbedPanel extends JPanel {

    public MyTabbedPanel() {
        super(new GridLayout(1, 1));
        JTabbedPane tabbedPane = new JTabbedPane();
        JComponent panel1 = MyJComponent1.getTest1Pannel();
        tabbedPane.addTab("3A1500", panel1);
        tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);

        JComponent panel2 = MyJComponent2.getTest2Pannel();
        tabbedPane.addTab("3A3000", panel2);
        tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);

        JComponent panel3 = MyJComponent3.getTest3Pannel();
        tabbedPane.addTab("LS2H1000", panel3);
        tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);

        JComponent panel4 = MyJComponent4.getTest4Pannel();
        tabbedPane.addTab("7A1000-I", panel4);
        tabbedPane.setMnemonicAt(2, KeyEvent.VK_4);

        JComponent panel5 = MyJComponent5.getTest5Pannel();
        tabbedPane.addTab("3A4000-I", panel5);
        tabbedPane.setMnemonicAt(2, KeyEvent.VK_5);

        JComponent panel6 = MyJComponent6.getTest6Pannel();
        tabbedPane.addTab("2K1000-J", panel6);
        tabbedPane.setMnemonicAt(2, KeyEvent.VK_5);
        add(tabbedPane);

        JComponent panel7 = MyJComponent7.getTest7Pannel();
        tabbedPane.addTab("2K1000-I", panel7);
        tabbedPane.setMnemonicAt(2, KeyEvent.VK_6);
        add(tabbedPane);

        JComponent panel8 = MyJComponent8.getTest8Pannel();
        tabbedPane.addTab("1A0300-I", panel8);
        tabbedPane.setMnemonicAt(2, KeyEvent.VK_7);
        add(tabbedPane);
    }
}
